
//
// Created by 1065246 on 2023/7/20.
//

#ifndef BASE_UNIONPERSON_H
#define BASE_UNIONPERSON_H
struct Foreigner {
    Foreigner(int s, int ph) : addr(s), phone(ph) {}
    int addr;
    int phone;
};

class UnionPerson {
    enum class Catrgory : char {
        Student, Local, Foreign
    };

public:
    UnionPerson(int num);
    UnionPerson(double idnum);
    UnionPerson(int addr,int phone);
    void print();
private:
    Catrgory catrgory;
    union {
        int number;
        double idNum;
        Foreigner foreigner;
    };

};
#endif //BASE_UNIONPERSON_H
